//
//  UIColor+ExHex.h
//  OC-Example
//
//  Created by lcj on 2020/11/3.
//  Copyright © 2020 apang.men. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

#define UIColor_ap_fromHexWithAlpha(hexValue, a) [UIColor colorWithRed:((float)((hexValue & 0xFF0000) >> 16))/255.0 green:((float)((hexValue & 0xFF00) >> 8))/255.0 blue:((float)(hexValue & 0xFF))/255.0 alpha:a]
#define UIColor_ap_fromHex(hexValue) UIColorFromHexWithAlpha(hexValue, 1.0)

@interface UIColor (ExHex)
/**
 * 16进制颜色转换
 *
 * @param hexStr 16进制颜色字符串，支持eg:#50D2C2、0X50D2C2、0x50D2C2
 * @discussion 默认alpha为1.0；
 *
 * @return UIColor
 */
+ (UIColor *)ap_colorWithHexStr:(NSString *)hexStr;
/**
 * 16进制颜色转换
 *
 * @param hexStr 16进制颜色字符串，支持eg:#50D2C2、0X50D2C2、0x50D2C2
 * @param alpha 默认alpha为1.0；
 *
 * @return UIColor
 */
+ (UIColor *)ap_colorWithHexStr:(NSString *)hexStr alpha:(CGFloat)alpha;
@end

NS_ASSUME_NONNULL_END
